<!-- 到期设备 -->
<template>
  <div class="app-container">
    <div class="titleMolde">当前状态
    </div>
    <div class="Filters">
      <el-input v-model="filters.devSN" style="width: 130px" placeholder="设备SN" />

      <el-input v-model="filters.devSN" style="width: 130px" placeholder="设备SN" />

      <el-select v-model="filters.devSN" placeholder="Select" style="width: 100px">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
      </el-select>

      <el-button type="primary" class="mrg-lf-10">赋值ID</el-button>
      <el-button type="primary" class="mrg-lf-10">导出Excel</el-button>
    </div>
    <el-table v-loading="loading" :data="pageData" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column key="id" label="编号" align="center" prop="id" width="100" />
      <el-table-column key="username" label="用户名" align="center" prop="username" />
      <el-table-column label="用户昵称" width="120" align="center" prop="nickname" />

      <el-table-column label="性别" width="100" align="center" prop="genderLabel" />

      <el-table-column label="部门" width="120" align="center" prop="deptName" />
      <el-table-column label="手机号码" align="center" prop="mobile" width="120" />

      <el-table-column label="状态" align="center" prop="status">
        <template #default="scope">
          <el-tag :type="scope.row.status == 1 ? 'success' : 'info'">
            {{ scope.row.status == 1 ? "启用" : "禁用" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
      <el-table-column label="操作" fixed="right" width="220">
        <!-- <template #default="scope"></template> -->
      </el-table-column>
    </el-table>
    <pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize" />
  </div>
</template>

<script setup lang="ts">
import type { TabsPaneContext } from "element-plus";
let value1 = ref("");
const loading = ref(false);
const removeIds = ref([]);
const total = ref(0);
const pageData = [
  {
    id: 3,
    username: "test",
    nickname: "测试小用户",
    mobile: "17621210366",
    genderLabel: "男",
    avatar:
      "https://oss.youlai.tech/youlai-boot/2023/05/16/811270ef31f548af9cffc026dfc3777b.gif",
    email: null,
    status: 1,
    deptName: "测试部门",
    roleNames: "访问游客",
    createTime: "2021-06-05",
  },
];
const options = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];

let filters = reactive({
  devSN: "",
});
/** 用户查询参数  */
const queryParams = {
  pageNum: 1,
  pageSize: 10,
};
/** 行复选框选中记录选中ID集合 */
function handleSelectionChange(selection: any) {
  removeIds.value = selection.map((item: any) => item.id);
}
const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event);
};
onMounted(() => {
  // handleQuery();
});
</script>
<style lang="scss" scoped>
.mrg-lf-10 {
  margin-left: 10px;
}

.titleMolde {
  font-weight: bold;
  position: relative;
  display: flex;
  padding-left: 15px;
  justify-content: space-between;
  align-items: center;

  &::after {
    content: "";
    width: 8px;
    height: 8px;
    position: absolute;
    left: 4px;
    top: 6px;
    background: #2cdfe5b5;
  }

  &::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #09e0e7;
    position: absolute;
    left: 0;
    top: 2px;
  }

}

.app-container {
  position: relative;
  padding: 10px;

  .allTabContent {
    display: flex;
    align-items: center;
    position: absolute;
    top: 15px;
    right: 0;

    div {
      margin-left: 26px;
      font-weight: 700;

      span {
        margin-left: 8px;
      }
    }
  }
}

.Filters {
  margin: 10px 0;
  display: flex;
  align-items: center;

  .el-segmented {
    --el-segmented-item-selected-color: var(--el-text-color-primary);
    --el-segmented-item-selected-bg-color: #5cadff;
    --el-border-radius-base: 16px;
  }

  &>div {
    margin-right: 5px;
  }
}
</style>
